class IframeCommunity {
  constructor() {
    this.godot_id = null;
  }

  init(iframe) {
    this.iframe = iframe;
    this.register();
  }
  //接收消息
  register() {
    this.iframe.contentWindow.addEventListener("message", (event) => {
      debugger;
      if (event.data.payload.type === "godot_id") {
        debugger;
        this.godot_id = event.data.payload.data.id;
      }
    });
  }
}
const iframe_community = new IframeCommunity();
export default iframe_community;
